import Mock from 'mockjs'

// 图标数据
let list = []
export default {
  getStatisticalData: () => {
    // 产生随机数，末流小数
    for (let i = 0; i < 7; i++) {
      list.push({
        Apple: Mock.Random.float(100, 8000, 0, 0),
        vivo: Mock.Random.float(100, 8000, 0, 0),
        oppo: Mock.Random.float(100, 8000, 0, 0),
        三星: Mock.Random.float(100, 8000, 0, 0),
        小米: Mock.Random.float(100, 8000, 0, 0),
        魅族: Mock.Random.float(100, 8000, 0, 0),
      })
    }
    return {
      code: 20000,
      data: {
        // 饼图
        videoData: [
          {
            name: 'Apple',
            value: 29999,
          },
          {
            name: 'vivo',
            value: 29999,
          },
          {
            name: 'oppo',
            value: 29999,
          },
          {
            name: '三星',
            value: 29999,
          },
          {
            name: '小米',
            value: 29999,
          },
          {
            name: '魅族',
            value: 10000,
          },
        ],
        // 柱图
        userData: [
          {
            date: '周一',
            new: 5,
            active: 200,
          },
          {
            date: '周二',
            new: 5,
            active: 200,
          },
          {
            date: '周三',
            new: 5,
            active: 200,
          },
          {
            date: '周四',
            new: 5,
            active: 200,
          },
          {
            date: '周五',
            new: 5,
            active: 200,
          },
          {
            date: '周六',
            new: 5,
            active: 200,
          },
          {
            date: '周日',
            new: 5,
            active: 200,
          },
        ],
        // 折线图
        orderData: {
          date: [
            '20191001',
            '20191002',
            '20191003',
            '20191004',
            '20191005',
            '20191006',
            '20191007',
          ],
          data: list
        },
        tableData: [
          {
            name: 'Apple',
            todayBuy: 400,
            monthBuy: 3000,
            totalBuy: 3400,
          },
          {
            name: 'vivo',
            todayBuy: 400,
            monthBuy: 3000,
            totalBuy: 3400,
          },
          {
            name: 'oppo',
            todayBuy: 400,
            monthBuy: 3000,
            totalBuy: 3400,
          },
          {
            name: '三星',
            todayBuy: 400,
            monthBuy: 3000,
            totalBuy: 3400,
          },
          {
            name: '小米',
            todayBuy: 400,
            monthBuy: 3000,
            totalBuy: 3400,
          },
          {
            name: '魅族',
            todayBuy: 400,
            monthBuy: 3000,
            totalBuy: 3400,
          }
        ]
      },
    }
  },
}
